<template>
    <example :template-code="templateString">
        <template #describe>
            <t :id="`${$t('基础示例')}`">{{ $t('基础示例') }}</t>
        </template>
        <sib-calculator @compute-finish="computeFinish"></sib-calculator>
    </example>
</template>

<script>
import { ElMessage } from 'element-plus';

export default {
    setup() {
        return {
            computeFinish(number) {
                ElMessage.info(`计算结果：${number}`);
            },
            templateString: `<template>
    <div class="example-box">
        <sib-calculator @compute-finish="computeFinish" />
    </div>
</template>

<script>
export default {
    setup() {
        return {
            computeFinish(number) {
                ElMessage.info(\`计算结果：\${number}\`);
            },
        };
    },
};
<\/script>`,
        };
    },
};
</script>
